# -*- ruby -*-

require 'rubygems'
require 'bundler/setup'
require 'rjack-tarpit'

RJack::TarPit.new( 'rjack-slf4j' ) do |tp|

  tp.spec.loaders.each do |adapter|
    file( "lib/rjack-slf4j/#{adapter}.rb" =>
          [ "lib/rjack-slf4j/base.rb", 'Rakefile' ] ) do
      open( "lib/rjack-slf4j/#{adapter}.rb", 'w' ) do |out|
        out.write <<END
require 'rjack-slf4j'
RJack::SLF4J.require_adapter( '#{adapter}' )
END
      end
    end
  end

end

desc "Upload RDOC to Amazon S3 (rdoc.gravitext.com/rjack, Oregon)"
task :publish_rdoc => [ :clean, :rerdoc ] do
  sh <<-SH
    aws s3 sync --acl public-read doc/ s3://rjack.gravitext.com/slf4j/
  SH
end
